/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	ComponentBillboard.h
*
*	Description -	Component for adding a billboarding behavior.
*
*	Comments	-	This component sets the look vector towards the active camera
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	06/13/2013	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_COMPONENT_BILLBOARD_H_
#define _PSX_COMPONENT_BILLBOARD_H_

#include "PulseSTD.h"
#include "IComponent.h"

namespace Pulse
{
	class ComponentBillboard : public IComponent
	{
	public:

		ComponentBillboard( Actor *pOwner );

		virtual ~ComponentBillboard( void );

		virtual EErrorCode::Type Initialize( XMLElementPtr pElem );

		virtual EErrorCode::Type PostInitialize( void );

		virtual const EComponent::Type GetType( void ) const { return EComponent::BILLBOARD; }

		virtual const CHAR * GetName( void ) const { return PSX_String("Billboard"); }

		virtual void Update( FLOAT dt );

	private:

		//	Scene Event Delegates
		//////////////////////////
		void OnSceneNewActiveCamera( IEvent *pEvent );


	private:

		// Cache the active camera actor and component
		// NOTE: We may want to make this generic and look at other types of object set.
		ActorWPtr		m_pActorCam;
		ComponentCamera *m_pCamera;

	};
}

#endif /* _PSX_COMPONENT_BILLBOARD_H_ */